* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "微软雅黑", sans-serif;
}
body {
  background-color: #f5f9ff;
  overflow-x: hidden;
}

/* 容器 */
.container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* 左侧信息栏 */
.sidebar {
  width: 480px;
  background-color: #e6f2ff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-y: auto; /* 允许左侧滚动 */
  height: 100vh; /* 左侧也占满视口高度 */
}

/* 导航栏样式 */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #4a90e2;
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 50px;
  margin-bottom: 20px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-container img {
  width: 22px;
  height: 22px;
}

.logo {
  color: white;
  font-weight: bold;
  text-decoration: none;
  font-size: 16px;
  white-space: nowrap;
}

.search-container {
  position: relative;
}

.search-input {
  border-radius: 20px;
  padding: 5px 10px;
  border: 1px solid #ddd;
  width: 140px;
  font-size: 13px;
  transition: width 0.3s;
}

.search-input:focus {
  width: 200px;
  outline: none;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-result-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}

.search-result-item:hover {
  background-color: #f5f9ff;
}

.search-result-item:last-child {
  border-bottom: none;
}

/* 天气内容区域 - 控制模块间距 */
.weather-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 当前天气模块 */
.current-weather {
  background-color: #d9efff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.current-weather .location {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
}
.current-weather .info-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}
.current-weather .weather-icon {
  font-family: 'qweather-icons' !important;
  font-size: 3em;
  color: #4a90e2;
  line-height: 1;
}
.current-weather .temp {
  font-size: 36px;
  font-weight: bold;
}
.current-weather .desc {
  font-size: 16px;
}
.current-weather .detail {
  font-size: 14px;
  margin-top: 10px;
  line-height: 1.5;
}
.current-weather .wind-humidity {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  font-size: 14px;
}

/* 未来几日预报模块 */
.forecast {
  background-color: #d9efff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.forecast h3 {
  font-size: 16px;
  margin-bottom: 15px;
  border-bottom: 1px solid #c6e0ff;
  padding-bottom: 8px;
}
.forecast-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #c6e0ff;
}
.forecast-item:last-child {
  border-bottom: none;
}
.forecast-item .date {
  font-size: 14px;
}
.forecast-item .weather {
  font-family: 'qweather-icons' !important;
  font-size: 1.5em;
  color: #4a90e2;
}
.forecast-item .temp-range {
  font-size: 14px;
}

/* 未来30天预报模块 */
.future-30d {
  background-color: #d9efff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.future-30d h3 {
  font-size: 16px;
  margin-bottom: 15px;
  border-bottom: 1px solid #c6e0ff;
  padding-bottom: 8px;
}
.future-30d p {
  font-size: 14px;
  line-height: 1.6;
}

/* 右侧区域 - 暂时简化 */
.main-content {
  flex: 1;
  display: flex;
  background-color: #fff;
  position: relative;
  overflow: hidden;
  padding: 0;
  justify-content: center;
  align-items: center;
  height: 100vh; /* 固定高度为视口高度 */
  position: sticky;
  top: 0;
}

.placeholder-text {
  color: #ccc;
  font-size: 24px;
  text-align: center;
}

.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #4a90e2;
  font-size: 18px;
  z-index: 1000;
  background: rgba(255,255,255,0.8);
  padding: 10px 20px;
  border-radius: 5px;
}

.debug-info {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(255,255,255,0.9);
  padding: 10px 15px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1000;
  max-width: 300px;
  font-size: 12px;
  color: #666;
}

/* 天气详情页样式 */
.weather-detail-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  z-index: 1000;
  overflow-y: auto;
  display: none;
}

.weather-detail-page.active {
  display: block;
}

/* 详情页头部 */
.detail-header {
  display: flex;
  align-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.back-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: background 0.3s;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.detail-location {
  color: white;
  font-size: 18px;
  font-weight: bold;
  margin-left: 15px;
}

/* 详情内容 */
.detail-content {
  padding: 20px;
  color: white;
}

/* 当前天气概况 */
.detail-current {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px 0;
}

.detail-temp {
  font-size: 64px;
  font-weight: bold;
  margin-bottom: 10px;
}

.detail-weather {
  font-size: 20px;
  margin-bottom: 10px;
  opacity: 0.9;
}

.detail-temp-range {
  font-size: 16px;
  opacity: 0.8;
}

/* 逐小时预报 */
.hourly-forecast {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.hourly-forecast h3 {
  margin-bottom: 15px;
  font-size: 16px;
  opacity: 0.9;
}

.hourly-container {
  display: flex;
  overflow-x: auto;
  gap: 20px;
  padding-bottom: 10px;
}

.hourly-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.hourly-time {
  font-size: 12px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.hourly-icon {
  font-family: 'qweather-icons' !important;
  font-size: 24px;
  margin-bottom: 8px;
}

.hourly-temp {
  font-size: 14px;
  font-weight: bold;
}

.hourly-pop {
  font-size: 10px;
  opacity: 0.7;
}

/* 天气详情网格 */
.weather-details-grid {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.weather-details-grid h3 {
  margin-bottom: 15px;
  font-size: 16px;
  opacity: 0.9;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

.detail-item .label {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 5px;
}

.detail-item .value {
  font-size: 16px;
  font-weight: bold;
}

.detail-item .icon {
  font-size: 20px;
  margin-bottom: 8px;
}

/* 生活指数 */
.living-index {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.living-index h3 {
  margin-bottom: 15px;
  font-size: 16px;
  opacity: 0.9;
}

.index-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.index-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

.index-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.index-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.index-name {
  font-size: 14px;
}

.index-level {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
}

/* 可点击效果 */
.clickable {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 滚动条样式 */
.hourly-container::-webkit-scrollbar {
  height: 4px;
}

.hourly-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.hourly-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.hourly-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* 错误消息样式 */
.error-message {
  color: #ff6b6b;
  text-align: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
  .navbar {
    flex-direction: column;
    height: auto;
    padding: 10px;
  }
  .search-input:focus {
    width: 150px;
  }
  .details-grid {
    grid-template-columns: 1fr;
  }
}
/* 气象图轮播样式 */
.weather-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
}

.carousel-container {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: 100%;
}

.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.carousel-controls {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 10;
}

.carousel-btn {
  background: rgba(255, 255, 255, 0.3);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.2);
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.7);
}

.weather-info-overlay {
  position: absolute;
  top: 30px;
  left: 30px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  padding: 15px 20px;
  border-radius: 12px;
  color: white;
  z-index: 10;
}

.overlay-content {
  text-align: center;
}

#carousel-weather-desc {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 5px;
}

#carousel-time-desc {
  font-size: 14px;
  opacity: 0.9;
}

/* 轮播图动画 */
@keyframes carouselFade {
  from {
    opacity: 0.8;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.carousel-slide.active {
  animation: carouselFade 0.8s ease-out;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .weather-info-overlay {
    top: 15px;
    left: 15px;
    padding: 10px 15px;
  }
  
  #carousel-weather-desc {
    font-size: 16px;
  }
  
  .carousel-controls {
    bottom: 20px;
  }
}